package com.example.cmpe277stockdata.RSSFeeds;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Set;

import com.example.cmpe277stockdata.beans.NewsBean;


//import com.foo.DAO.Data_analyser_DAO;


public class ResultClass 
{
	//static FileWriter fstream;
	 static BufferedWriter out;
	 public static String[] comparearray = new String[]{"Intel","Ericcson","Oracle","Apple","Hewlett-Packard","Yahoo","Microsoft","Cisco","Google","Qualcomm","Dell","General Electric","EBay"};
	 public static String[] tickerarray =  new String[]{"INTC:Intel","AAPL:Apple","HPQ:Hewlett-Packard","YHOO:Yahoo","MSFT:Microsoft","CSCO:Cisco","DELL:Dell","GE:General Electric","EBAY:EBay","ORCL:Oracle","ERIC:Ericsson","QCOM:Qualcomm","GOOG:Google","PG:Procter & Gamble","MOVE:Move Inc","TSLA:Tesla Motors",
		    "PFE:Pfizer Inc","SFLY:Shutterfly Inc","F:Ford Motor Co","CVX:Chevron Corp","JPM:JPMorgan Chase","BAC:Bank Of America Corp","NKE:Nike Inc","MRK:Merck & Co","GSK:GSKGlaxoSmithKline PLC","NVS:Novartis","BA:Boeing Inc","DE:Deere & Co","LNN:Lindsay Corp",
		    "CRM:Salesforce.com","VMW:Vmware Inc","ADBE:Adobe Systems Inc","INTU:Intuit Inc","SYMC:Symantec Corp","CTXS:Citrix Systems","XOM:Exxon Mobile","PSX:Phillips 66","GME:GameStop Corp"};													
	 //"INTC","APPL","HPQ","YHOO","MSFT","CSCO","DELL","GE","EBAY","ORCL","ERIC","QCOM","GOOG","PG"
	 public static String[] company = new String[2];
	 public static String[] description = new String[2];
	 public static String nodescription;
	 
	public static void printresponse(Set<NewsBean> rss)
	{
		int size=rss.size();
		for(NewsBean rss1  : rss)
		{
			try 
			{
				company = rss1.getNewsTitle().split("#");
				description = rss1.getNewsDescription().split("#");
				if(description.length == 1)
				{
					nodescription = description[0];
					//daoClass.insertNewsData(company[0],company[1], nodescription);
				}
				else if(description.length > 1)
				{
					//daoClass.insertNewsData(company[0],company[1], description[1]);
				}
				
				//daoClass.insertNewsData(company[0],company[1], description[1]);

			} 
			catch (Exception e) 
			{
				e.printStackTrace();
			}
		}

	}
	
}

